import java.io.Closeable;
import java.util.Arrays;
import java.util.Scanner;

import javax.naming.directory.SearchControls;
import javax.naming.ldap.SortControl;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] ints=new int[1];
		while(sc.hasNextLine()) {
			String choice = sc.nextLine();
			switch (choice) {
			case "fib":
				int x=Integer.parseInt(sc.nextLine());
				fib(x);
				break;
			case "sort":
				String line =sc.nextLine();
				String[] strsStrings = line.split("");
				ints = new int[strsStrings.length];
				for (int i = 0; i < ints.length; i++) {
					ints[i]=Integer.parseInt(strsStrings[i]);
				}
				Arrays.sort(ints);
				Arrays.asList(ints);
				break;
			case "search":
				int key =Integer.parseInt(sc.nextLine());
				
				int ans= Arrays.binarySearch(ints, key);
				System.out.println(ans);
				break;
			case "getBirthDate":
				
				break;
			default:
				System.out.println("exit");
				return;
			}
		}
	
	}

	//private static void search(int f) {
		
		
	//}

	/*private static void sort(String line) {
		String[] strsStrings = line.split("");
		int[] ints = new int[strsStrings.length];
		for (int i = 0; i < ints.length; i++) {
			ints[i]=Integer.parseInt(strsStrings[i]);
		}
		Arrays.sort(ints);
		Arrays.asList(ints);
	}*/

	private static void fib(int x) {
		int[] ints = new int[x+1];
		ints[0]=ints[1]=1;
		for (int i = 2; i < x; i++) {
			ints[i]=ints[i-1]+ints[i-2];
		}
		System.out.print(ints[0]);
		for (int i = 0; i < x; i++) {
			System.out.print(" "+ints[i]);
		}
		System.out.println();
	}

}
